环境

  • ubuntu18.04
  • elasticsearch7.4
  • 开放服务器对应 es 端口(主机端口+云安全组端口)

编辑 elasticsearch.yml 配置文件

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
# Set the bind address to a specific IP (IPv4 or IPv6):
#
#network.host: 192.168.0.1
# 1、指定自己的 IP 地址(内网或外网)
network.host: 0.0.0.0

# 2、设置节点名称
node.name: node-1

# 3、设置初始主节点
cluster.initial_master_nodes: ["node-1"]

# 4、设置跨域
http.cors.enabled: true
http.cors.allow-origin: "*"

参考文章